#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#define pi  (3.141592653589793)


using namespace std;

struct ty
{
    double jin,wei;
	double x,y,z;
}city[1002];
int ncity;

double map[1002][1002];

double dis(int a, int b)
{
	double jiao, dd;
	if (a==b) return 0;
	dd=city[a].x*city[b].x+city[a].y*city[b].y+city[a].z*city[b].z;
	jiao=acos(dd);
	return jiao;
}

main()
{

	int i, j, site;
	double a,b, tot, ans;
 
	while (scanf("%d", &ncity)!=EOF)
	{
		
		for (i=1; i<=ncity; ++i)
		{
    		scanf("%lf%lf", &a, &b);
    		city[i].jin=a;
    		city[i].wei=b;
    		a=a*pi/180;
    		b=b*pi/180;
    		city[i].x=cos(a)*cos(b);
    		city[i].y=cos(a)*sin(b);
    		city[i].z=sin(a);
    		
		}  		
		for (i=1; i<=ncity; ++i)
		{
		    for (j=i; j<=ncity; ++j)		    	
		    	{
		    	    map[i][j] = map[j][i] = dis(i,j);
		    	}    
		}    
		
		
		for (i=1; i<=ncity; ++i)
		{
		    tot = map[i][1];
			for (j=1;j<=ncity; ++j)
				 if (tot<map[i][j]) tot = map[i][j];
		    map[i][0] = tot;
		}
		
/*		for (i=1; i<=ncity; ++i,printf("\n"))
			for (j=0; j<=ncity; ++j)
				printf("%lf ", map[i][j]);
				
*/				
  	    ans = map[1][0];
  	    site = 1;
        for (i=2; i<=ncity; ++i)
        	if (ans > map[i][0])
        	{
         	    ans = map[i][0];
         	    site = i;
         	}    
       	if (ncity==1) 
       	{
		  	printf("%.2lf %.2lf\n", city[1].jin, city[1].wei);
		  	continue;
		}   	
      // 	for (i=1; i<=ncity; ++i)
       //      if (fabs(ans-map[i][0])<1e-7)
       i=site;
       		       	printf("%.2lf %.2lf\n", city[i].jin, city[i].wei);
	}


	

	return 0;
}
